#!/usr/bin/python3

import nmap
nm = nmap.PortScanner()
PORT = [21,22,80,3306,8080]
nm.scan('192.168.0.0/24','21,22,80,3306,8080',arguments='')

for i in nm.all_hosts():
    for n in PORT:
        if nm[i]['tcp'][n]['state'] == 'open':
            print("ip: %s port: %s is up " %(i,n))